package com.yutel.phone.binh.ui;

import java.util.Stack;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class BaseActivity extends Activity {
	public static Stack<Activity> activityList = new Stack<Activity>();

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		activityList.add(this);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		activityList.remove(this);
	}

	public static void finishActivitys() {
		for (int i = 0; i < activityList.size(); i++) {
			if (null != activityList.get(i)) {
				activityList.get(i).finish();
			}
		}
		activityList.clear();
		Log.d("BaseActivity", "quit");
		System.exit(0);
	}
}